package com.aaa.service.mht.impl;

import com.aaa.dao.mht.TesterMhtDao;
import com.aaa.entity.mht.TesterMht;
import com.aaa.service.mht.TesterMhtService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author ：Lim
 * @date ：Created in 2022/9/5 10:49
 * @description：测试者业务层实现类
 * @modified By：
 * @version:
 */
@Service("testerMhtService")
public class TesterMhtServiceImpl implements TesterMhtService {
    @Resource
    private TesterMhtDao testerMhtDao;

    @Override
    public TesterMht insert(TesterMht testerMht) {
        int i = testerMhtDao.insert(testerMht);
        if (i > 0) {
            return testerMht;
        }
        return null;
    }

    @Override
    public TesterMht update(TesterMht testerMht) {
        int i = testerMhtDao.update(testerMht);
        if (i > 0) {
            return testerMht;
        }
        return null;

    }

    @Override
    public boolean deleteById(Integer id) {
        int i = testerMhtDao.deleteById(id);
        if (i > 0) {
            return true;
        }
        return false;
    }

    @Override
    public TesterMht queryByPhone(String phone) {
        TesterMht testerMht = testerMhtDao.queryByPhone(phone);
        return testerMht;

    }
}
